package com.lyn.auxiliarytool.views.dialog;


import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;

import com.lyn.auxiliarytool.R;

/**
 * 确认dialog
 *
 * @author Lyn 2022/12/5
 * @version 1.0.0
 */
public abstract class ConfirmDialog {

    public ConfirmDialog(Context context, String title, String message) {
        new AlertDialog.Builder(context)
                .setTitle(title)
                .setMessage(message)
                .setNeutralButton(context.getString(R.string.cancel), this::onCancel)
                .setNegativeButton(context.getString(R.string.determine), this::onConfirm)
                .show();
    }

    public void onCancel(DialogInterface dialog, int which) {

    }

    public abstract void onConfirm(DialogInterface dialog, int which);

}
